/**
 * 
 */
package com.point.business.util;

import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

import com.point.business.database.model.User;

/**
 * @author Ilija Trajkoski
 * 
 */
public class Settings {
	private static Properties properties;
	private static Logger logger = Logger.getLogger(Settings.class);

	public synchronized static String getValue(String key) {
		getProperties();
		return properties.getProperty(key);
	}

	public synchronized static Properties getProperties() {
		if (properties == null) {
			properties = new Properties();
			try {
				properties.load(User.class.getClassLoader()
						.getResourceAsStream("settings.properties"));
			} catch (IOException e) {
				logger.error(e);
			}
		}
		return properties;
	}
}
